﻿@model VenueBookRecordSearchModel
@{
    ViewBag.Title = "场馆预定记录";
}

<form method="POST" role="form">
    <ul>
        <li>
            <input name="Phone" placeholder="请输入预定时填写的手机号" maxlength="11" required="" type="tel" value="@Model.Phone"/>
        </li>
        <li>
            <input name="Start" placeholder="预定日期 自" required="" type="date" value="@Model.Start.ToString("yyyy-MM-dd")"/>
        </li>
        <li>
            <input name="End" placeholder="预定日期 到" required="" type="date" value="@Model.End.ToString("yyyy-MM-dd")"/>
        </li>
        <li style="margin-top: 20px; text-align: center">
            <input type="submit" value="查 询" id="submit"/>
        </li>
    </ul>
    @Html.ValidationSummary()
</form>

@if (Model.Results != null && !Model.Results.Any())
{
    <p style="text-align: center">没有查询到数据</p>
}
else if (Model.Results != null)
{
    <ul id="result">
        @foreach (var item in Model.Results)
        {
            var statusText = "";
            var statusClass = "";
            switch (item.Status.ToString())
            {
                case "Pass":
                    statusText = "通过";
                    statusClass = "text-green";
                    break;
                case "Failed":
                    statusText = "未通过";
                    statusClass = "text-red";
                    break;
                default:
                    statusText = "未审核";
                    break;
            }
            <li>
                <dl>
                    <dt>场馆</dt>
                    <dd>@item.VenueName</dd>
                    <dt>面积（平方米）</dt>
                    <dd>@item.Area</dd>
                    <dt>可容纳人数</dt>
                    <dd>@item.Capacity</dd>
                    <dt>设备</dt>
                    <dd>@item.Devices</dd>
                    <dt>用途</dt>
                    <dd>@item.Purpose</dd>
                    <dt>预定人</dt>
                    <dd>@item.BookName</dd>
                    <dt>预定用途</dt>
                    <dd>@item.Reason</dd>
                    <dt>时段</dt>
                    <dd>
                        @foreach (var d in item.Days)
                                        {
                            <p>@d.Day @d.BookType</p>
                        }
                    </dd>
                    <dt>审核状态</dt>
                    <dd class="@statusClass">@statusText</dd>
                    <dt>审核说明</dt>
                    <dd class="@statusClass">@Html.Raw(string.IsNullOrEmpty(item.StatusDescription)?"无": item.StatusDescription)</dd>
                </dl>
            </li>
        }
    </ul>
}
@section css
{
    <style>
        body {
            background: black;
            background-image: url('/Assets/bg_performance.png');
            background-size: 100% auto;
            background-repeat: no-repeat;
            color: white;
        }
         h1 {
             margin: 30px 0;
             text-align: center;
         }
        form>ul>li {
            text-align: center;
        }
        form>ul>li>input {
            margin: auto;
        }
        li {
            margin: 10px;
        }

        .text-green {
            color: green;
        }

        .text-red {
            color: red;
        }

        #result > li {
            border: 1px solid grey;
            border-width: 1px 0 0 0;
        }

        input, select {
            margin: auto;
            width: 90%;
            height: 44px;
            border-radius: 10px;
            font-size: 20px;
            padding-left: 10px;
            text-align: center;
        }

        #submit {
            border-radius: 10px;
            border: 2px solid white;
            background: transparent;
            color: white;
            margin: auto;
            width: 94%;
        }

        dt {
            color: #ccc;
        }

        dd {
            font-size: 18px;
            margin: 5px 0 15px 0;
            -ms-word-wrap: break-word;
            word-wrap: break-word;
        }

        @@media (max-width: 360px) {
            input, select {
                height: 30px;
                font-size: 16px;
                border-radius: 5px;
            }
            #submit {
                border-radius: 5px;
            }
        }
    </style>
}

